﻿/*
Copyright (c) 2008 William Duff

Permission is hereby granted, free of charge, to any person obtaining a copy 
of this software and associated documentation files (the "Software"), to deal 
in the Software without restriction, including without limitation the rights 
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all 
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 
SOFTWARE.
*/

using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;

namespace LiveUpload.Facebook
{
    /// <summary>
    /// Data related to Facebook permissions.
    /// </summary>
    public class Permissions
    {
        #region Constructors

        /// <summary>
        /// Constructs a new Permissions object to represent Facebook permissions for a given user.
        /// </summary>
        public Permissions(bool offlineAccess, bool photoUpload, bool videoUpload)
        {
            this.offlineAccess = offlineAccess;
            this.photoUpload = photoUpload;
            this.videoUpload = videoUpload;
        }

        #endregion

        #region Private Fields

        private bool offlineAccess;
        private bool photoUpload;
        private bool videoUpload;

        #endregion

        #region Public Fields

        /// <summary>
        /// Indicates whether the user allows your application to access that user's data when the 
        /// user is offline or doesn't have an active session.
        /// </summary>
        public bool CanAccessOffline
        {
            get { return this.offlineAccess; }
        }

        /// <summary>
        /// Indicates whether the user allows your application to upload and tag photos on the 
        /// user's behalf. Uploading or tagging a photo on behalf of a user that has not set this 
        /// permission will cause the photo to enter a pending state that requires manual approval.
        /// </summary>
        public bool CanUploadPhotos
        {
            get { return this.photoUpload; }
        }

        /// <summary>
        /// Indicates whether the user allows your application to upload videos on the user's behalf.
        /// Attempting to upload a video on behalf of a user that has not set this permission will
        /// result in an error.
        /// </summary>
        public bool CanUploadVideos
        {
            get { return this.videoUpload; }
        }

        #endregion
    }
}
